package fr.neyb.bernouilli;

import java.lang.reflect.Method;
import java.util.ResourceBundle;

public class Entry {

	public static void main(String... args) throws Exception {

		if (args.length < 1)
			throw new IllegalArgumentException("specify an problem to solve");

		for (String arg : args) {
			Method m = Class.forName(
					ResourceBundle.getBundle("general").getString("ClassTemplate")
							.replace("<N>", arg)).getMethod("main",
					String[].class);
			long milli = System.currentTimeMillis();
			m.invoke(null, (Object) new String[0]);

			System.out.println((double) (System.currentTimeMillis() - milli) / 1000
					+ "s to solve the problem " + args[0]);
		}
		;
	}
}
